// INSE6260-ATM Simulator Project

/**
 * Model package contains core code of ATMS
 */
package com.inse6260.atms.model;

/**
 * Class represents a bank client
 * @author dimitri.tiago
 * @version 1.0.0
 */
public class BankClient
{
    // fields
    private boolean authorized;      // authorized to use ATM?
    private boolean blocked;         // blocked bank client
    private int cardNumber;          // card number
    private int pin;                 // pin
    private int noOfLogInRetries;    // number of login retries
    private float dailyTransLimit;     // daily transaction limit
    private float maxOneTimeWithAmt; // maximum one time withdrawal amount

    /**
     * No-argument constructor provides blank initialization;
     */
    public BankClient()
    {
        // initialize fields
        authorized        = false;
        cardNumber        = 0;
        pin               = 0;
        dailyTransLimit   = 0;
        blocked           = false;
        maxOneTimeWithAmt = 0;
    }

    /**
     * Set authorization to use ATMS
     * @param authorized authorization to use ATMS
     */
    public void setAuthorized(boolean authorized)
    {
        this.authorized = authorized;
    }

    /**
     * Returns user authorization to use ATMS
     */
    public boolean getAuthorized()
    {
        return authorized;
    }

    /**
     * Returns BankClient card number
     * @return card number
     */
    public int getCardNumber()
    {
        return cardNumber;
    }

    /**
     * Set BankClient card number
     * @param cardNumber BankClient card number
     */
    public void setCardNumber(int cardNumber)
    {
        this.cardNumber = cardNumber;
    }

    /**
     * Set BankClient daily transaction limit
     * @param newDailyTransLimit new daily transaction limit
     */
    public void setDailyTransLimit(float newDailyTransLimit)
    {
        dailyTransLimit = newDailyTransLimit;
    }

    /**
     * Returns daily transaction limit
     * @return daily transaction limit
     */
    public float getDailyTransLimit()
    {
        return dailyTransLimit;
    }

    /**
     * Returns BankClient maximum one time withdrawal amount
     * @return maximum one time withdrawal amount
     */
    public float getMaxOneTimeWithAmt()
    {
        return maxOneTimeWithAmt;
    }

    /**
     * Set max one time withdrawal amount
     * @param maxOneTimeWithAmt maximum one time withdrawal amount
     */
    public void setMaxOneTimeWithAmt(float newMaxOneTimeWithAmt)
    {
        maxOneTimeWithAmt = newMaxOneTimeWithAmt;
    }

    /**
     * Increment number of login retries by 1
     */
    public void incNoOfLoginRetries()
    {
        noOfLogInRetries++;
    }

    /**
     * Returns number of login retries
     */
    public int getNoOfLoginRetries()
    {
        return noOfLogInRetries;
    }

    /**
     * Set BankClient blocked state
     * @param blockedState
     */
    public void setBlocked(boolean blockedState)
    {
        blocked = blockedState;
    }

    /**
     * Returns block status of BankClient
     * @return blocked status of bank client
     */
    public boolean getBlocked()
    {
        return blocked;
    }

    /**
     * Sets BankClient Pin
     * @param pin personal identification number
     */
    public void setPin(int pin)
    {
        this.pin = pin;
    }

    /**
     * Returns BankClient pin
     * @return personal identification number
     */
    public int getPin()
    {
        return pin;
    }
}
